set the visible of card field 1 to not the visible of card field 1
if the visible of card field 1 is true then
set the name of me to "Hide Pascal Source"
else set the name of me to "Show Pascal Source"
end mouseUp
-- part contents for background part 16
----- text -----
PICTURESHOW XCMD version 1.0.1
PICTUREHIDE XCMD version 1.0
Kevin Calhoun
NOTE TO USERS OF POPUPPICTURE: PictureShow is a revision and extension of PopUpPicture and includes all of PopUpPicture's features. You can use PictureShow in place of PopUpPicture, if you make two changes to your parameters: change the first parameter you passed to PopUpPicture, the ID of a PICT resource, to the name of that PICT resource, and make sure you pass "onPress" as the fifth parameter if you want the picture to disappear the next time the mouse button is pressed and "onRelease" if you want the picture to disappear the next time the mouse button is released. With these changes, PictureShow will work exactly as PopUpPicture did. But if you want to know what the new features are, read on...
PictureShow opens a window on top of the current card and displays a picture in it. The type of window in which the picture is displayed can be any of the standard Macintosh window types. The window will automatically be sized to fit the entire picture. You can dispose of the window in two ways: 1) automatically when a mouse event occurs or 2) within a script, as the result of a call to PictureHide.
Color pictures (in PICT2 format) will appear in color on a suitably equipped Macintosh and will appear in monochrome on any other machine running System 4.1 or later. PictureShow extracts color table information from pictures in PICT2 format in order to display them in their proper colors.
You tell PictureShow what picture to draw by passing it the name of a resource of type PICT, which can be contained in the current stack or in any other open resource file, including the home stack, HyperCard, or the System file. Any picture you've copied to the clipboard can become a resource of type PICT--use the ClipToPICT XFCN to achieve this transformation and to install the new PICT resource in your stack. A file of type PICT can be converted to a PICT resource using the PICTFileToRes XFCN.
The name of the PICT resource you pass to PictureShow becomes the title of the window it creates (even when the title is not visible, as in the case of window types that have no title bar). You tell PictureHide what window to dispose of by passing it the same name you passed to PictureShow. If there are two or more windows of the same name created by PictureShow on the screen at the same time, PictureHide will dispose of the one closest to the front.
PictureShow takes six parameters, only the first of which is required.
The pictureName is the name of the PICT resource you want displayed. You should enclose this name in quotation marks.
The left and top parameters become the horizontal and vertical coordinates of the upper left corner of the picture, given as coordinates in the card window's coordinate system. A left of 0 and a top of 0 would draw the picture flush against the upper left corner of the card window. If either of these parameters is absent, PictureShow centers the picture on the main screen.
PictureShow will draw any of the five standard kinds of windows--a windowKind of 0 produces a regular document window with a title bar (but no go-away box), a windowKind of 1 produces a box with a double border, a windowKind of 2 produces a plain box, a windowKind of 3 produces a plain box with shadow, and a windowKind of 16 produces a window with rounded corners and a black title bar. If windowKind is any value other than these, the results depend on which WDEF resources are installed. (If that doesn't make any sense to you, don't worry--nothing bad will happen if you use a far-out value for windowKind.) If the windowKind parameter is absent, PictureShow defaults to a regular document window with a title bar.
If you want the picture to remain present until the next time the user pushes the mouse button, pass "onPress" in the fourth parameter, whenToDispose. If you want the picture to remain present until the next time the user releases the mouse button, pass "onRelease" as whenToDispose. If you want the window to remain on the screen until you call PictureHide to get rid of it, pass "stay" as whenToDispose. If you don't provide this parameter, or if you pass something PictureShow doesn't recognize, PictureShow leaves the window on the screen until PictureHide is called to dispose of it. (Note: For compatibility with PopUpPicture, TRUE means the same thing as onRelease.)
If you want the event that causes the picture to be removed (a mouseDown if whenToDispose is onMouseUp, a mouseUp if whenToDispose is onMouseUp) to be passed on to HyperCard so that it causes a HyperTalk message to be generated, pass "true" in the passThru parameter.
INVOKING PICTUREHIDE
PictureHide pictureName
The only parameter pictureName takes is the name of the window to be disposed of, which is the same as the name of the PICT that's drawn in the window. (Note: PictureHide disposes only of windows that PictureShow created.)
EXAMPLES:
PictureShow "Butterfly",40,56,3,onPress
PictureShow "Dartmouth Arms",19,34,2,stay
PictureHide "Dartmouth Arms"
REVISION HISTORY
1.0 -- May 4, 1989.
1.0.1 -- June 17, 1989. Will not display picture unless at least 33K of memory will remain free after the picture is loaded and the window is drawn. (HyperCard quits if it finds less than 32K of memory free on idle.)
-- part contents for card part 5
----- text -----
UNIT PopUpPicture;
{ PictureShow XCMD © 1988-1989 by the Trustees of Dartmouth College }
{ Written by Kevin Calhoun }
{ This source compatible with MPW Pascal 3.0 }
(*
Pascal PictureShow.p
Link -m ENTRYPOINT Γêé
-o "YourFile" Γêé
-rt XCMD=6464 Γêé
-sn Main=PictureShow Γêé
PictureShow.p.o Γêé
"{Libraries}"interface.o Γêé
"{PLibraries}"Paslib.o Γêé
"{Libraries}"HyperXLib.o
*)
{$R-}
INTERFACE
USES
Types,
Memory,
Windows,
Palettes,
OSEvents,
Desk,
Resources,
ToolUtils,
Packages,
HyperXCmd;
TYPE Disposal = (onMouseDown, onMouseUp, letItLive);